let URL=";"
if(process.env.NODE_ENV=="development"){
	URL="https://api.aslegou.top"
}else{
	URL="https://api.aslegou.top"
}
export {URL}

export default (options)=>{
	let url=URL+"/api/"+options.url
	return new Promise((resolve,reject)=>{
		uni.request({
			url,
			method:options.method,
			data:options.data||{},
			header:options.header || {
				"content-Type":"application/json",
				"authorization":uni.getStorageSync('token') || '',
				},
			success:res=>resolve(res.data),
			fail:err=>reject(err)
		})
	})
}